﻿using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Collections.ObjectModel;
using Resn.WhuPub.BLL;

namespace Resn.WhuPub.WPFClientUI
{
        /// <summary>
        /// SystemPage.xaml 的交互逻辑
        /// </summary>
        public partial class EmployeeBusinessPage : Page
        {
                private readonly GlobalManager _gm = GlobalManager.Instance;

                public EmployeeBusinessPage()
                {
                        InitializeComponent();
                }

                private void Page_Loaded(object sender, RoutedEventArgs e)
                {
                        LayoutRoot.DataContext = _gm;
                }

                private void UpdateEmployeeButton_Click(object sender, RoutedEventArgs e)
                {
                        new UpdateEmployeeWindow().ShowDialog();
                }

                private void UpdatePasswordButton_Click(object sender, RoutedEventArgs e)
                {
                        new UpdatePasswordWindow().ShowDialog();
                }
                

                private void TravelFlowButton_Click(object sender, RoutedEventArgs e)
                {
                        _gm.TravelFlows = new ObservableCollection<TravelFlow>(_gm.LoginEmployee.TravelFlows);
                        NavigationService.Navigate(new Uri("ManageTravelFlowsPage.xaml", UriKind.Relative));
                }

                private void FeedbackFlowButton_Click(object sender, RoutedEventArgs e)
                {
                        _gm.FeedbackFlows = new ObservableCollection<FeedbackFlow>(_gm.LoginEmployee.FeedbackFlows);
                        NavigationService.Navigate(new Uri("ManageFeedbackFlowsPage.xaml", UriKind.Relative));
                }


                private void BookFlowButton_Click(object sender, RoutedEventArgs e)
                {
                        _gm.BookFlows = new ObservableCollection<BookFlow>(_gm.LoginEmployee.BookFlows);
                        NavigationService.Navigate(new Uri("ManageBookFlowsPage.xaml", UriKind.Relative));
                }

                private void InvoiceFlowButton_Click(object sender, RoutedEventArgs e)
                {
                        _gm.InvoiceFlows = new ObservableCollection<InvoiceFlow>(_gm.LoginEmployee.InvoiceFlows);
                        NavigationService.Navigate(new Uri("ManageInvoiceFlowsPage.xaml", UriKind.Relative));
                }
        }
}